home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Button;
- import java.awt.Checkbox;
- import java.awt.CheckboxGroup;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Event;
- import java.awt.Font;
- import java.awt.Label;
- import java.awt.LayoutManager;
- import java.awt.Panel;
- import java.awt.TextArea;
- import java.awt.TextField;
- import symantec.itools.awt.WrappingLabel;
- import symantec.itools.lang.Context;
- import symantec.itools.util.Timer;
-
- public class Email extends Applet {
- Label label1;
- TextField textField1;
- Label label2;
- TextField textField2;
- Label label3;
- TextField textField3;
- Label label4;
- TextField textField4;
- Label label5;
- TextField textField5;
- Label label6;
- TextField textField6;
- Label label7;
- TextField textField7;
- Label label8;
- TextField textField8;
- Label label9;
- TextField textField9;
- Label label10;
- Checkbox radioButton1;
- CheckboxGroup Group1;
- Checkbox radioButton2;
- Checkbox radioButton3;
- Label label11;
- TextArea textArea1;
- Label label12;
- TextArea textArea2;
- Button button1;
- Button button2;
- WrappingLabel wrappingLabel1;
- Timer timer1;
-
- void Email_GotFocus(Event event) {
- this.textField7.setText("");
- }
-
- void timer1_TimerEvent(Event event) {
- this.wrappingLabel1.hide();
- this.textField1.setText("");
- this.textField2.setText("");
- this.textField3.setText("");
- this.textField4.setText("");
- this.textField5.setText("");
- this.textField6.setText("");
- this.textField7.setText("");
- this.textField8.setText("");
- this.textField9.setText("");
- this.textArea1.setText("");
- this.textArea2.setText("");
- this.radioButton1.setState(true);
- }
-
- void button2_Clicked(Event event) {
- this.timer1.start();
- this.wrappingLabel1.show();
- }
-
- void button1_Clicked(Event event) {
- this.textField1.setText("");
- this.textField2.setText("");
- this.textField3.setText("");
- this.textField4.setText("");
- this.textField5.setText("");
- this.textField6.setText("");
- this.textField7.setText("");
- this.textField8.setText("");
- this.textField9.setText("");
- this.textArea1.setText("");
- this.textArea2.setText("");
- this.radioButton1.setState(true);
- }
-
- public void init() {
- super.init();
- Context.setDocumentBase(((Applet)this).getDocumentBase());
- ((Container)this).setLayout((LayoutManager)null);
- ((Panel)this).addNotify();
- ((Applet)this).resize(503, 585);
- ((Component)this).setFont(new Font("Dialog", 1, 12));
- ((Component)this).setForeground(new Color(0));
- ((Component)this).setBackground(new Color(16777215));
- this.label1 = new Label("Name");
- this.label1.reshape(0, 8, 120, 28);
- ((Container)this).add(this.label1);
- this.textField1 = new TextField();
- this.textField1.reshape(128, 8, 349, 30);
- ((Container)this).add(this.textField1);
- this.label2 = new Label("Address");
- this.label2.reshape(0, 48, 120, 28);
- ((Container)this).add(this.label2);
- this.textField2 = new TextField();
- this.textField2.reshape(128, 48, 349, 30);
- ((Container)this).add(this.textField2);
- this.label3 = new Label("City/Town");
- this.label3.reshape(0, 88, 120, 28);
- ((Container)this).add(this.label3);
- this.textField3 = new TextField();
- this.textField3.reshape(128, 88, 349, 30);
- ((Container)this).add(this.textField3);
- this.label4 = new Label("State/County");
- this.label4.reshape(0, 128, 120, 28);
- ((Container)this).add(this.label4);
- this.textField4 = new TextField();
- this.textField4.reshape(128, 128, 349, 30);
- ((Container)this).add(this.textField4);
- this.label5 = new Label("Country Code");
- this.label5.reshape(0, 168, 120, 28);
- ((Container)this).add(this.label5);
- this.textField5 = new TextField();
- this.textField5.reshape(128, 168, 349, 30);
- ((Container)this).add(this.textField5);
- this.label6 = new Label("Zip Code/Postcode");
- this.label6.reshape(0, 208, 128, 28);
- ((Container)this).add(this.label6);
- this.textField6 = new TextField();
- this.textField6.reshape(128, 208, 349, 30);
- ((Container)this).add(this.textField6);
- this.label7 = new Label("Telephone");
- this.label7.reshape(0, 248, 120, 28);
- ((Container)this).add(this.label7);
- this.textField7 = new TextField();
- this.textField7.reshape(128, 248, 349, 30);
- ((Container)this).add(this.textField7);
- this.label8 = new Label("Fax");
- this.label8.reshape(0, 288, 120, 28);
- ((Container)this).add(this.label8);
- this.textField8 = new TextField();
- this.textField8.reshape(128, 288, 349, 30);
- ((Container)this).add(this.textField8);
- this.label9 = new Label("E-mail");
- this.label9.reshape(0, 328, 120, 28);
- ((Container)this).add(this.label9);
- this.textField9 = new TextField();
- this.textField9.reshape(128, 328, 349, 30);
- ((Container)this).add(this.textField9);
- this.label10 = new Label("What types of tours are you interested in?");
- this.label10.reshape(0, 368, 476, 35);
- ((Container)this).add(this.label10);
- this.Group1 = new CheckboxGroup();
- this.radioButton1 = new Checkbox("Custom", this.Group1, false);
- this.radioButton1.reshape(16, 400, 88, 32);
- ((Container)this).add(this.radioButton1);
- this.radioButton2 = new Checkbox("Package", this.Group1, false);
- this.radioButton2.reshape(120, 400, 88, 32);
- ((Container)this).add(this.radioButton2);
- this.radioButton3 = new Checkbox("Both", this.Group1, false);
- this.radioButton3.reshape(224, 400, 88, 32);
- ((Container)this).add(this.radioButton3);
- this.label11 = new Label("How did you find out about us?");
- this.label11.reshape(0, 432, 476, 27);
- ((Container)this).add(this.label11);
- this.textArea1 = new TextArea();
- this.textArea1.reshape(16, 464, 469, 64);
- ((Container)this).add(this.textArea1);
- this.label12 = new Label("Do you have any other comments?");
- this.label12.reshape(0, 536, 476, 26);
- ((Container)this).add(this.label12);
- this.textArea2 = new TextArea();
- this.textArea2.reshape(16, 568, 469, 64);
- ((Container)this).add(this.textArea2);
- this.button1 = new Button("Clear");
- this.button1.reshape(144, 648, 102, 31);
- ((Container)this).add(this.button1);
- this.button2 = new Button("Submit Request");
- this.button2.reshape(256, 648, 102, 31);
- ((Container)this).add(this.button2);
- this.wrappingLabel1 = new WrappingLabel();
- this.wrappingLabel1.hide();
- this.wrappingLabel1.reshape(160, 688, 184, 40);
- this.wrappingLabel1.setFont(new Font("Dialog", 1, 14));
- ((Container)this).add(this.wrappingLabel1);
- this.wrappingLabel1.setAlignStyle(1);
- this.wrappingLabel1.setText("Submitting request... (Simulated)");
- this.timer1 = new Timer(this, 3000, false);
- this.timer1.start();
- }
-
- public boolean handleEvent(Event event) {
- if (event.target == this.button1 && event.id == 1001) {
- this.button1_Clicked(event);
- return true;
- } else if (event.target == this.button2 && event.id == 1001) {
- this.button2_Clicked(event);
- return true;
- } else if (event.target == this.timer1 && event.id == 1001) {
- this.timer1_TimerEvent(event);
- return true;
- } else {
- return super.handleEvent(event);
- }
- }
- }
-